Skip to content

Conversation

@ongchi
Copy link
Collaborator

@ongchi ongchi commented Jul 1, 2024

This PR include some breaking changes:

  • Rename the project into wagtail_polymath
  • Add support of KaTex rendering engine
  • Add Django settings options:
    • WAGTAIL_POLYMATH: The default value of rendering engine is mathjax. katex is also supported. Can also specify specific version of rendering engine from CDN, or from self provisioned django static files.
  • Rename html template namespace from wagtailmath to wagtail_polymath

@zerolab
Copy link
Contributor

zerolab commented Jul 4, 2024

Thank you for this @ongchi
Somehow I did not get any notice of the PR. Will aim to look at it soon.
If we're updating the namespace, I think we should:

  1. bump the version to 2.0
  2. add upgrade instructions
  3. should claim wagtail-polymath on PyPI

@zerolab
Copy link
Contributor

zerolab commented Jul 8, 2024

The main changes needed

  1. a rebase on main
  2. keeping the src/ structure

@zerolab zerolab added this to the Version 2.0 milestone Jul 8, 2024
@ongchi
Copy link
Collaborator Author

ongchi commented Jul 21, 2024

Hi @zerolab,
Sorry for the late response, I'm still working on this PR.
This PR would break some APIs as introduces a new rendering engine and bumps the version number anyway. So it could also be a opportunity to rename the project at the same time.

I should find some time to update the README and add some relevant tests in this PR.

@zerolab zerolab mentioned this pull request Jul 22, 2024
@ongchi ongchi marked this pull request as ready for review September 22, 2024 09:21
@ongchi ongchi requested a review from zerolab September 22, 2024 09:21
Copy link
Contributor

@zerolab zerolab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. Did a first pass review. Need to check the widget side of things and test it locally in another pass.

Left some minor suggestions/notes

@@ -0,0 +1,58 @@
from django.conf import settings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to self: move settings to a lazy object a la Django settings

paths = WAGTAILPOLYMATH_SETTINGS.get(key, [])

# Return absolute path to the asset if it's a static file path.
return [versioned_static(path) if finders.find(path) else path for path in paths]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we skip running finders.find if path starts with http ?

paths = POLYMATH_SETTINGS.get(key, [])

# Return absolute path to the asset if it's a static file path.
return [versioned_static(path) if finders.find(path) else path for path in paths]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good to have this URL validation, so I am adding validation logic for a generic URL.

@ongchi ongchi requested a review from zerolab October 5, 2024 15:27
@weber-s
Copy link

weber-s commented Jul 10, 2025

Hello there!

We just wanted to include math support in one of our project, and we find wagtailkatex :) Seeing this PR may leed us to use wagtail-polymath instead. Is this PR still going?

We might spend some time to upgrade it to support wagtail 7 also if needed.

@lb-
Copy link
Member

lb- commented Jul 16, 2025

@ongchi @zerolab how can I help here?
Maybe we can try to break this PR up or something, or do you need me to do some manual testing?

@ongchi
Copy link
Collaborator Author

ongchi commented Aug 7, 2025

Sorry for the late reply! I’m planning to split this PR into a few smaller ones to make it easier to review.

I’ve manually tested it, and everything seems to work fine from Wagtail 5.2 up to 6.1. However, the latest version (7.1) hasn’t been tested yet.
It would be great if someone could help test it on 7.1!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants